<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8"/>
	<meta name="keywords" content="syntax coloring, syntax style, Outline, completion"/>
	<link rel="stylesheet" href="../../Shared/sty/standard.css"/>
	<script defer src="../../Shared/js/toc.js"></script>
	
	<title>Define a syntax in CotEditor on Mac</title>
</head>

<body>

<h1>Define a syntax in CotEditor on Mac</h1>

<p>Use the syntax editor in CotEditor to edit the built-in syntaxes or create your own.</p>


<section>
<h2>Open the syntax editor</h2>

<p>To open the syntax editor, do the following:</p>
<ol>
	<li><p>Go to the CotEditor app <img class="appicon" srcset="../../Shared/gfx/icon_32x32@2x.png 2x" alt=""/> on your Mac.</p></li>
	<li><p>Choose CotEditor &gt; Settings, then click Format.</p></li>
	<li><ul>
		<li><p>To customize an existing syntax:</p><ol>
			<li><p>Select the syntax you want to customize in the “available syntaxes” list.</p></li>
			<li><p>Double-click the syntax name, or click the Edit button.</p></li>
		</ol></li>
		<li><p>To define a new syntax:</p><ol>
			<li><p>Click the Add button below the “available syntaxes” list.</p></li>
		</ol></li>
	</ul></li>
</ol>
</section>


<section>
<h2>Edit a syntax definition</h2>

<p>In the syntax editor, you can configure the following features:</p>
<ul>
	<li><p><em>Name</em>: Set the name of the syntax.</p></li>
	<li><p><em>Kind</em>: Specify whether the syntax is for coding or for general purpose. This option affects the editor’s font and behavior set in <a href="settings_mode.html">Mode settings</a>.</p></li>
	<li><p><em><a href="syntax_highlight_settings.html">highlighting elements</a></em>: Define the rules for syntax highlighting.</p></li>
	<li><p><em><a href="syntax_comment_settings.html">Comments</a></em>: Define comment delimiters and related highlighting rules.</p></li>
	<li><p><em><a href="syntax_outline_settings.html">Outline</a></em>: Define how outline items are extracted and formatted.</p></li>
	<li><p><em><a href="syntax_completion_settings.html">Completion</a></em>: Define completion candidates.</p></li>
	<li><p><em><a href="syntax_file_mapping.html">File Mapping</a></em>: Define what kind of files use this syntax.</p></li>
	<li><p><em><a href="syntax_metadata_settings.html">Information</a></em>: Edit metadata for the syntax definition.</p></li>
	<li><p><em>Validation</em>: Verify that no grammatical or formatting errors exist in the definition.</p></li>
</ul>
</section>


<section id="cf">
<h2>See also</h2>
<ul>
	<li><a href="syntax_overview.html">Analyze the syntax of a document</a></li>
	<li><a href="settings_format.html">Change Format settings</a></li>
</ul>
</section>

</body>
</html>
